package de.tu_darmstadt.gdi1.battleship.model;

import java.io.File;
import java.io.IOException;
import java.sql.Time;
import java.text.DateFormat;

import javax.swing.text.DateFormatter;

import de.tu_darmstadt.gdi1.battleship.exceptions.InternalFailureException;
import de.tu_darmstadt.gdi1.battleship.exceptions.InvalidLevelFileException;
import de.tu_darmstadt.gdi1.battleship.exceptions.ParameterOutOfRangeException;
import de.tu_darmstadt.gdi1.battleship.view.StudentWindow;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		BattleshipGame bsg = new BattleshipGame();
		

		
		
		
		StudentWindow mainWnd = new StudentWindow("* B a t t l e s h i p *", bsg);
		mainWnd.setResizable(true);
		mainWnd.setSize(400, 100);
		mainWnd.setVisible(true);
		
		File f = new File("src/de/tu_darmstadt/gdi1/resources/levels/defaultlevels/01.lvl");
		
		try {
			bsg.readLvlFromFile(f);
		} catch (IOException e) {
			e.printStackTrace();
		} catch (InvalidLevelFileException e) {
			e.printStackTrace();
		}
		
		try {
			mainWnd.notifyLevelLoaded(21, 10);
		} catch (ParameterOutOfRangeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InternalFailureException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
//		System.out.println(bsg.toString());

		
	}

}
